|
RAIS
3.2
|
00001 using System; 00002 using System.Collections.Generic; 00003 using System.Text; 00004 using NUnit.Framework; 00005 using RAIS.Common.UserManagement; 00006 using RAIS.DataAccessLayer; 00007 00008 namespace RAIS.DataAccessLayerTest.CommonClasses 00009 { 00010 [TestFixture] 00011 public class FacilityTest 00012 { 00013 private int expectedID = 1; 00014 private string expectedName = "Test Facility"; 00015 00016 private Facility facility; 00017 00018 [SetUp] 00019 public void Init() 00020 { 00021 facility = new Facility(); 00022 facility.ID = this.expectedID; 00023 facility.Name = this.expectedName; 00024 } 00025 [Test] 00026 public void GetID() 00027 { 00028 // Test 00029 Assert.AreEqual(this.expectedID, this.facility.ID); 00030 } 00031 [Test] 00032 public void GetName() 00033 { 00034 // Test 00035 Assert.AreEqual(this.expectedName, this.facility.Name); 00036 } 00037 [Test] 00038 public void SetName() 00039 { 00040 // Preparation 00041 string expectedNewName = "New Test Facility"; 00042 00043 // Test 00044 this.facility.Name = expectedNewName; 00045 00046 // Check 00047 Assert.AreEqual(expectedNewName, this.facility.Name); 00048 } 00049 [Test] 00050 public void RestricitonsConflict() 00051 { 00052 bool returnStatus; 00053 Facility newFacility = new Facility(); 00054 newFacility.Name = RAIS.Common.Constants.ALL_FACILITIES; 00055 00056 // Test 00057 returnStatus = facility.RestricitonsConflict(newFacility); 00058 00059 // Check 00060 Assert.IsTrue(returnStatus, "RestricitonsConflict error:"); 00061 } 00062 } 00063 }